﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace SPAdaptiveMenu
{
    internal static class XHelper
    {
        internal static string AttributeValue(this XElement element, string name)
        {
            return element.Attribute(name) == null
                       ? string.Empty
                       : element.Attribute(name).Value;
        }

        internal static bool AttributeValueEqual(this XElement element, string name, string val)
        {
            return element.AttributeValue(name).Equals(val, StringComparison.InvariantCultureIgnoreCase);
        }
    }
}
